package homework29;

import homework21.Data;

import java.text.SimpleDateFormat;
@SuppressWarnings({"all"})
public class ProxyOutput extends Output{
    private RealOutput realOutput = new RealOutput();

    public void before(){
        Data data = new Data();
        SimpleDateFormat simpleDateFormat  =
                new SimpleDateFormat("2021-11-3");
        System.out.println("方法method()调用成功，调用时间为"
                + simpleDateFormat);
    }

    @Override
    public void method() {
        before();
        try {
            realOutput.method();
            after();
        }catch (NumberFormatException e){
            System.out.println("方法method调用失败...");
        }
    }

    public void after(){
        System.out.println("method()方法被调用成功...");
    }
}